Prelim 1 topics
Topics/ideas
- Scalar variables and operations
- Conditionals (
if
statements, if
-else
statements, if
-elseif
-else
statements)
- Iteration (
while
-loop, for
-loop), including nested loops, and loop patterns/algorithms (e.g., accumulation, finding the best in a set)
- User-defined functions
- 1-dimensional array (vector)
- linear interpolation
- Vectorized code
(For Prelim 1 you only need to recognize what is or is not vectorized code; you do not need to write vectorized code.) The vectorized code you should be aware of are in the 10 lines after "These vectors can be" on page 69 in the textbook (chapter 4.1).
- MATLAB predefined (built-in) functions (those used in lecture/discussion/projects)
- good programming style (store important variables, use meaningful variable names, semicolons at the end of variable assignment lines, ...)
Students are responsible for all material covered in lecture, discussion,
exercises, projects, and the assigned reading:
- Lecture: up to and including Lecture 12, plus the part of Lecture 13 on vectorized code. Note that 2-d array (matrix) will NOT be covered in Prelim 1.
- Exercises: Exercises 1-6 and problem 1-2 on exercise 7
- Projects: Projects 1, 2, and 3
- Assigned reading: See “Lecture materials”, up to and including Lecture 12
Examples on how to use selected MATLAB predefined (built-in) functions will be given on the exam. Do not use any built-in functions that have not been discussed in lecture, discussion, homework, and assigned reading. Write scripts and functions as specified in each exam question; specifically, write functions and subfunctions only if they are requested.
Matlab commands that students may not use:
switch
break
continue
return